package cn.powertime.evaluation.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
public class ReqAutomaticTopicListVo implements Serializable {

    @ApiModelProperty(value = "习题ID", position = 1)
    @NotNull(message = "习题ID不能为空")
    private Long id;

    @ApiModelProperty(value = "习题类型:单选题，2:多选题，3:判断题，4:问答题", position = 2)
    @NotNull(message = "习题类型不能为空")
    private Integer type;

    @ApiModelProperty(value = "习题题干", position = 3)
    @NotBlank(message = "习题题干不能为空")
    private String topicStem;

    @ApiModelProperty(value = "A选项", position = 4)
    //@NotBlank(message = "A选项不能为空")
    private String optionA;

    @ApiModelProperty(value = "B选项", position = 5)
    //@NotBlank(message = "B选项不能为空")
    private String optionB;

    @ApiModelProperty(value = "C选项", position = 6)
    //@NotBlank(message = "C选项不能为空")
    private String optionC;

    @ApiModelProperty(value = "D选项", position = 7)
    //@NotBlank(message = "D选项不能为空")
    private String optionD;

    @ApiModelProperty(value = "用户答案", position = 8)
    private String userAnswer;

    @Override
    public String toString() {
        if (StringUtils.isEmpty(userAnswer)) {
            return "{id:" + id + ",type:" + type + ",topicStem:'" + topicStem + "',optionA:'" + optionA + "',optionB:'" + optionB + "',optionC:'" + optionC + "',optionD:'" + optionD + "',userAnswer:" + null + "}";
        } else {
            return "{id:" + id + ",type:" + type + ",topicStem:'" + topicStem + "',optionA:'" + optionA + "',optionB:'" + optionB + "',optionC:'" + optionC + "',optionD:'" + optionD + "',userAnswer:'" + userAnswer + "'}";
        }
    }

}
